<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/TR/REC-html40" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml"><head>



<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="ProgId" content="Word.Document">
<meta name="Generator" content="Microsoft Word 10">
<meta name="Originator" content="Microsoft Word 10">
<link rel="File-List" href="http://icpcres.ecs.baylor.edu/onlinejudge/external/103/p13_files/filelist.xml">
<link rel="Edit-Time-Data" href="http://icpcres.ecs.baylor.edu/onlinejudge/external/103/p13_files/editdata.mso">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>Problem N - GWCF Contest 4 - The Decider</title>
<o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PlaceName"></o:smarttagtype>
<o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PlaceType"></o:smarttagtype>
<o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"></o:smarttagtype>
<!--[if gte mso 9]><xml>
 <o:DocumentProperties>
  <o:Author>Shahriar Manzoor</o:Author>
  <o:LastAuthor>Shahriar Manzoor</o:LastAuthor>
  <o:Revision>182</o:Revision>
  <o:TotalTime>1514</o:TotalTime>
  <o:LastPrinted>2002-06-17T05:30:00Z</o:LastPrinted>
  <o:Created>2000-12-04T12:45:00Z</o:Created>
  <o:LastSaved>2002-06-28T09:01:00Z</o:LastSaved>
  <o:Pages>1</o:Pages>
  <o:Words>198</o:Words>
  <o:Characters>1133</o:Characters>
  <o:Company>CSE, BUET</o:Company>
  <o:Lines>9</o:Lines>
  <o:Paragraphs>2</o:Paragraphs>
  <o:CharactersWithSpaces>1329</o:CharactersWithSpaces>
  <o:Version>10.2625</o:Version>
 </o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Print</w:View>
  <w:Zoom>90</w:Zoom>
  <w:GrammarState>Clean</w:GrammarState>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>0</w:DisplayVerticalDrawingGridEvery>
  <w:UseMarginsForDrawingGridOrigin/>
  <w:Compatibility>
   <w:FootnoteLayoutLikeWW8/>
   <w:ShapeLayoutLikeWW8/>
   <w:AlignTablesRowByRow/>
   <w:ForgetLastTabAlignment/>
   <w:LayoutRawTableWidth/>
   <w:LayoutTableRowsApart/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><!--[if !mso]><object
 classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id=ieooui></object>
<style>
st1\:*{behavior:url(#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Courier;
	panose-1:2 7 4 9 2 2 5 2 4 4;
	mso-font-alt:"Courier New";
	mso-font-charset:0;
	mso-generic-font-family:modern;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:3 0 0 0 1 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
h1
	{mso-style-next:Normal;
	margin:0in;
	margin-bottom:.0001pt;
	text-align:justify;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:1;
	font-size:12.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	color:black;
	mso-font-kerning:0pt;
	font-weight:normal;
	font-style:italic;}
p.MsoBodyText, li.MsoBodyText, div.MsoBodyText
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
p.MsoBodyText2, li.MsoBodyText2, div.MsoBodyText2
	{margin:0in;
	margin-bottom:.0001pt;
	text-align:justify;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;
	mso-bidi-font-weight:bold;}
em
	{mso-bidi-font-style:normal;}
p
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
pre
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
	font-size:10.0pt;
	font-family:"Courier New";
	mso-fareast-font-family:"Times New Roman";}
tt
	{font-family:"Courier New";
	mso-ascii-font-family:"Courier New";
	mso-fareast-font-family:"Times New Roman";
	mso-hansi-font-family:"Courier New";
	mso-bidi-font-family:"Courier New";}
p.Preformatted, li.Preformatted, div.Preformatted
	{mso-style-name:Preformatted;
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:none;
	tab-stops:0in 47.95pt 95.9pt 143.85pt 191.8pt 239.75pt 287.7pt 335.65pt 383.6pt 431.55pt 479.5pt;
	layout-grid-mode:char;
	font-size:10.0pt;
	font-family:"Courier New";
	mso-fareast-font-family:"Times New Roman";
	mso-bidi-font-family:"Times New Roman";}
span.GramE
	{mso-style-name:"";
	mso-gram-e:yes;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin:0in;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";}
table.MsoTableGrid
	{mso-style-name:"Table Grid";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	border:solid windowtext 1.0pt;
	mso-border-alt:solid windowtext .5pt;
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-border-insideh:.5pt solid windowtext;
	mso-border-insidev:.5pt solid windowtext;
	mso-para-margin:0in;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";}
</style>
<![endif]--><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="27650"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1"/>
 </o:shapelayout></xml><![endif]-->
</head><body style="" lang="EN-US">

<div class="Section1">

<p class="MsoNormal" style="text-align: center;" align="center"><b style=""><span style="font-size: 18pt;">Problem N<o:p></o:p></span></b></p>

<p class="MsoNormal" style="text-align: center;" align="center"><b style=""><span style="font-size: 24pt;">Zeros and Ones </span><o:p></o:p></b></p>

<p class="MsoNormal" style="text-align: center;" align="center"><b><span style="">Input: </span></b><span style="">standard input<o:p></o:p></span></p>

<p class="MsoNormal" style="text-align: center;" align="center"><b><span style="">Output: </span></b><span style="">standard output<o:p></o:p></span></p>

<p class="MsoNormal" style="text-align: center;" align="center"><b><span style="">Time Limit:</span></b><span style=""> 2 seconds<o:p></o:p></span></p>

<p class="MsoNormal" style="text-align: center;" align="center"><b style=""><span style="">Memory Limit: </span></b><span style="">32 MB<o:p></o:p></span></p>

<p class="MsoNormal" style="text-align: justify;"><o:p>&nbsp;</o:p></p>

<p class="MsoNormal" style="text-align: justify;"><span style="color: windowtext;">Given a string of <b style="">0's</b>
and <b style="">1's</b> up to <b style="">1000000</b> characters long and indices <b style=""><span style="">i</span></b> and <b style=""><span style="">j</span></b>,
you are to answer a question whether all characters between position <span class="GramE"><b style=""><span style="">min(</span></b></span><b style=""><span style="">i,j)</span></b> and position <b style=""><span style="">max(i,j)</span></b>
(inclusive) are the same. <o:p></o:p></span></p>

<p class="MsoNormal" style="text-align: justify;"><span style="color: windowtext;"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style=""><b style=""><span style="font-size: 18pt; color: windowtext;">Input<o:p></o:p></span></b></p>

<p class="MsoNormal" style="text-align: justify;"><span style="color: windowtext;">There
are multiple cases on input. The first line of each case gives a string of <b style="">0's</b> and <b style="">1's</b>. The next line contains a positive integer <b style=""><span style="">n</span></b> giving the number
of queries for this case. The next <b style=""><span style="">n</span></b> lines contain queries, one per
line. Each query is given by two non-negative integers, <b style=""><span style="">i</span></b> and <b style=""><span style="">j</span></b>.
For each query, you are to print </span><b style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: windowtext;">Yes</span></b><span style="color: windowtext;"> if all characters in the
string between position <b style=""><span style="">min(i,j)</span></b> and position <b style=""><span style="">max(i,j)</span></b>
are the same, and </span><b style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: windowtext;">No</span></b><span style="color: windowtext;"> otherwise.</span><b style=""><span style="font-size: 18pt; color: windowtext;"><o:p></o:p></span></b></p>

<p class="MsoNormal" style="text-align: justify;"><span style="color: windowtext;"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style=""><b style=""><span style="font-size: 18pt; color: windowtext;">Output<o:p></o:p></span></b></p>

<p class="MsoNormal" style="text-align: justify;"><span style="color: windowtext;">Each
case on output should start with a heading as in the sample below. The input
ends with an empty string that is a line containing only the new line
character, this string should not be processed. The input may also with end of
file. So keep check for both.</span><b style=""><span style="font-size: 18pt; color: windowtext;"><o:p></o:p></span></b></p>

<p class="MsoNormal" style="text-align: justify;"><b style=""><span style="color: windowtext;"><o:p>&nbsp;</o:p></span></b></p>

<p class="MsoNormal" style="text-align: justify;"><b style=""><span style="font-size: 18pt;">Sample Input</span><o:p></o:p></b></p>

<pre>0000011111</pre><pre>3</pre><pre>0 5</pre><pre>4 2</pre><pre>5 9</pre><pre>01010101010101010101010101111111111111111111111111111111111110000000000000000</pre><pre>5</pre><pre>4 4</pre><pre>25 60</pre><pre>1 3</pre><pre>62 76</pre><pre>24 62</pre><pre>1</pre><pre>1</pre><pre>0 0</pre><pre><o:p>&nbsp;</o:p></pre>

<p class="MsoNormal" style="text-align: justify;"><b><span style="font-size: 18pt;">Sample Output</span><o:p></o:p></b></p>

<pre>Case 1:</pre><pre>No</pre><pre>Yes</pre><pre>Yes</pre><pre>Case 2:</pre><pre>Yes</pre><pre>Yes</pre><pre>No</pre><pre>Yes</pre><pre>No</pre><pre>Case 3:</pre><pre>Yes</pre>

<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: windowtext;">

<hr size="2" width="100%" align="center">

</span></div>

<p class="MsoNormal" style=""><b><span style="">(The Decider Contest, Source: </span></b><st1:place><st1:placetype><b><span style="">University</span></b></st1:placetype><b><span style=""> of </span></b><st1:placename><b><span style="">Alberta</span></b></st1:placename></st1:place><b><span style=""> Local Contest)</span></b><span style="font-family: Courier; color: windowtext;"><o:p></o:p></span></p>

</div>

</body></html>